<?php
class model_NewsModel {
    private $title;
    private $content;
    private $id;
    private $author;
    private $date;
    private $img;

    public function  __construct($row = null) {
        
        if (null != $row){        
        $this->setId($row['id'])
                ->setTitle($row['title'])
                ->setContent($row['content'])
                ->setAuthor($row['author'])
                ->setDate($row['date'])
                ->setImg($row['img']);
        }
    }

    public  function setId($id) {
        $this->id = $id;
        return $this;
    }

    public  function getId() {
        return $this->id;
    }

    public  function setAuthor($author) {
        $this->author = $author;
        return $this;
    }

    public  function getAuthor() {
        return $this->author;
    }

    public  function setTitle($title) {
        $this->title = $title;
        return $this;
    }

    public  function getTitle() {
        return $this->title;
    }

    public  function setContent($content) {
        $this->content = $content;
        return $this;
    }

    public function getContent() {
        return $this->content;
    }

    public  function setDate($date) {
        $this->date = $date;
        return $this;
    }

    public  function getDate() {
        return $this->date;
    }
    
    public function getImg() {
        return $this->img;
    }

    public function setImg($img) {
        $this->img = $img;
        return $this;
    }
}